class CreateUsers < ActiveRecord::Migration[5.2]
  def change
    create_table :users do |t|
      t.string :name
      t.string :weixin
      t.string :avatar
      t.string :phone
      t.string :address
      t.string :open_id  
      t.string :access_token
      t.string :refresh_token
      t.integer :expires_in
      t.string :provider
      t.string :uid
      t.string :nickname
      t.integer :sex
      t.integer :subscribe, default: 0
      t.string :wechat_avatar
      t.string :password_digest
      t.decimal :moneybag, :precision => 10, :scale => 2, :default => 0.0
      t.string :registration_id
      t.integer :parent_id

      t.timestamps
    end
  end
end
